import home from "@/components/home"
import user from "@/components/user"
import about from "@/components/about"
import news from '@/components/home/news'
import messages from '@/components/home/messages'
import msgDetails from '@/components/home/messages/msgDetails'

const routes = [
  {
    path:"/home",
    component:home,
    children:[
      {path:'news',component:news},
      {
        path:'messages',
        component:messages,
        children:[
          {
            path:'msgDetails',
            component: msgDetails,
            props(route){
              return {
                id:route.query.id
              }
            }
          }
        ]
      }
    ]
  },
  {
    path:"/user",
    component:user,
    props(route){
      return{
        id: route.query.id
      }
    },
    children:[
      {
        path:':id',
        component: user,
        props: true
      }
    ]
  },
  {path:"/about",component:about},
  {path:"",redirect:"/home"}
]

export default routes
